import java.util.Arrays;

public class Target {
    public static int[] target(int[] arr1, int goal){
        int[] ret = {-1, -1};
        int left = 0;
        int right = arr1.length;
        for (int i = 0; i < arr1.length; i++) {
            for (int j = 0; j < arr1.length; j++) {
                if(arr1[i] + arr1[j] == goal){
                     ret[0] =i;
                     ret[1] = j;
                    return ret;
                }
            }
        }
        return  ret;
    }
    public static void main(String[] args) {
        int[] arr={1 ,3 ,4 ,5 ,9};
        target(arr,5);
        System.out.println(Arrays.toString(target(arr,5)));

    }
}
